Skip to content

fix: skip random challenge when no bot is found#1210

Merged
AttackingOrDefending merged 1 commit into
lichess-bot-devs:masterfrom
ilAYAli:fix/no-none-challenge
May 31, 2026
Merged

fix: skip random challenge when no bot is found#1210
AttackingOrDefending merged 1 commit into
lichess-bot-devs:masterfrom
ilAYAli:fix/no-none-challenge

Conversation

@ilAYAli

@ilAYAli ilAYAli commented May 26, 2026

Copy link
Copy Markdown
Contributor

Return immediately when matchmaking cannot pick an opponent, avoiding the misleading 'Will challenge None' log line.

Validation: python3 -m py_compile lichess-bot/lib/matchmaking.py

Type of pull request:

  • Bug fix
  • Feature
  • Other

Description:

When random matchmaking finds no suitable online bot, choose_opponent() returns no username. The
caller already avoids creating a challenge in that case, but it still logs Will challenge None for a standard game.

This change returns immediately when no opponent was selected, clears the stored challenge id, and logs
that no challenge will be created.

Related Issues:

[Reference any related issues that this pull request addresses or closes. Use the syntax Closes #issue_number to automatically close the linked issue upon merging.]

Checklist:

  • I have read and followed the contribution guidelines.
  • I have added necessary documentation (if applicable).
  • The changes pass all existing tests.

Screenshots/logs (if applicable):

ERROR    No suitable bots found to challenge.
INFO     Will challenge None for a standard game.

After:

ERROR    No suitable bots found to challenge.
INFO     No challenge will be created.

Comment thread lib/matchmaking.py
@MarkZH MarkZH self-requested a review May 30, 2026 11:30
@ilAYAli ilAYAli force-pushed the fix/no-none-challenge branch from 1dd9052 to aaaa7da Compare May 30, 2026 14:30
Return immediately when matchmaking cannot pick an opponent, avoiding the misleading 'Will challenge None' log line.

Validation: python3 -m py_compile lichess-bot/lib/matchmaking.py
@ilAYAli ilAYAli force-pushed the fix/no-none-challenge branch from aaaa7da to dccf60e Compare May 31, 2026 08:06
@AttackingOrDefending AttackingOrDefending merged commit 70bc417 into lichess-bot-devs:master May 31, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants